<template>
    <div class="homes">
        <van-nav-bar title="品质管理">
            <!-- <van-nav-bar title="品质管理" left-arrow @click-left="onClickLeft"> -->
        </van-nav-bar>
        <div class="list-back">
            <div class="list-item-back" v-for="(item, index) in listData" :key="index">
                <div class="item-time">2022-08-17 20:16</div>
                <div class="item-back">
                    <div v-for="(iItem, iIndex) in [1,2,3,4]" :key="iIndex">
                        <div class="first-back" v-if="iIndex == 0">
                            <div class="back-img">
                                <div class="first-title">
                                    8月16号总部近期重点关注的部分指标监控通报
                                </div>
                            </div>
                        </div>
                        <div class="other-back" :class="iIndex == 3 ? 'other-radius-back' : 'other-back'" v-else>
                            <div class="other-title">8月16号总部近期重点关注的部分指标监控通报</div>
                            <div class="right-img"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="menu-back">
            <div class="menu-item" @click="toServiceManager">
                服务管理
            </div>
            <div class="menu-item-line" @click="toMicro">
                微平台
            </div>
            <div class="menu-item">
                更多
            </div>
        </div>
    </div>
</template>

<script>
import "@/api/index"
import { ref, reactive, toRefs, onMounted } from "vue"
import store from "@/store/index"
import { useRouter } from "vue-router"
export default {
    setup() {
        let state = reactive({
            listData:[1,2,3,4,5,6]
        })
        const onClickLeft = () => history.back()
        const router = useRouter()
        function toServiceManager(){
            router.push({name:'service-manager'})
        }
        function toMicro(){
            router.push({name:'micro-platform'})
        }
        return {
            ...toRefs(state),
            onClickLeft,
            toServiceManager,
            toMicro
        }
    },
}
</script>

<style lang="scss" scoped>
    .homes{
        width: 100%;
        height: 100%;
        background: #eaeaea;
        overflow: hidden;

        .list-back{
            width: 100%;
            height: calc(100% - 100px);
            overflow-y: auto;
            .list-item-back{
                margin: 10px;
                display: flex;
                flex-direction: column;
                align-items: center;
                .item-time{
                    padding: 10px;
                    font-size: 8px;
                    background-color: #D0D0D0;
                    border-radius: 5px;
                    color: #FFFFFF;
                }  

                .item-back{
                    margin-top: 10px;
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    background-color: #FFFFFF;
                    border-radius: 5px;

                    .first-back{
                        border: 1px solid #D9D9D9;
                        border-top-right-radius: 5px;
                        border-top-left-radius: 5px;
                        .back-img{
                            background: url("../../assets/icon/wx_notice_bg.png")
                                no-repeat 0 0;
                            background-size: 100% 100%;
                            margin: 10px;
                            display: flex;
                            flex-direction: column;
                            justify-content: flex-end;
                            flex: 1;
                            height: 120px;

                            .first-title{
                                margin: 10px;
                                font-size: 14px;
                                color: #FFFFFF;
                            }
                            
                        }
                    }

                    .other-back{
                        // margin-top: 10px;
                        
                        display: flex;
                        border-left: 1px solid #D9D9D9;
                        border-right: 1px solid #D9D9D9;
                        border-bottom: 1px solid #D9D9D9;
                        height: 64px;
                        width: 100%;
                        align-items: center;
                        .other-title{
                            width: 80%;
                            font-size: 12px;
                            margin: 10px;
                        }

                        .right-img{
                            background: url("../../assets/icon/wx_icon_bzqjk.png")
                                no-repeat 0 0;
                            background-size: 100% 100%;
                            margin-right: 10px;
                            height: 54px;
                            width: 54px;
                        }
                    }

                    .other-radius-back{
                        border-bottom-right-radius: 5px;
                        border-bottom-left-radius: 5px;
                    }
                }
            }

        }
        
        .menu-back{
            height: 54px;
            width: 100%;
            background: #FFFFFF;
            font-size: 20px;
            display: flex;
            flex-direction: row;
            justify-content: space-around;
            align-items: center;

            .menu-item {
                font-size: 10px;
                width: 33%;
                height: 36px;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .menu-item-line {
                font-size: 10px;
                width: 33%;
                height: 36px;
                display: flex;
                align-items: center;
                justify-content: center;
                border-left: 1px solid #D9D9D9;
                border-right: 1px solid #D9D9D9;
            }
        }
    }

</style>